package tsg.component;

import tsg.laf.LookAndFeel;
import tsg.laf.LookAndFeelManager;
import tsg.util.Dimension;
import tsg.util.Point;

public class Frame extends Window
{
	protected Frame()
	{
		this("");
	}
	
	public Frame(String title)
	{
		super(title);
		
		this.setUI(LookAndFeelManager.getComponentUI(LookAndFeel.KEY_FRAME_COMPONENTUI));
		_systemFrame = WindowFactory.createSystemFrame(title, this);
	}
	
	public void setVisible(boolean isVisible)
	{
		super.setVisible(isVisible);
		_systemFrame.setVisible(isVisible);
	}
	
	public void setPosition(Point position)
	{
		super.setPosition(position);
		_systemFrame.setPosition(position);
	}
	
	public void setSize(Dimension dimension)
	{
		super.setSize(dimension);
		_systemFrame.setSize(dimension);
	}
	
	public void setPreferredSize(Dimension dimension)
	{
		super.setPreferredSize(dimension);
		_systemFrame.setPreferredSize(dimension);
	}
	
	protected void systemFrameResized(Dimension dimension)
	{
		super.setSize(dimension);
	}

	private SystemFrame _systemFrame = null;
}
